<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/1/12
  Time: 13:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="webroot" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <title>${title}</title>
    <script src="${webroot}/element/vue.js"></script>
    <link rel="stylesheet" href="${webroot}/element/index.css">
    <script src="${webroot}/element/index.js"></script>
    <link rel="stylesheet" type="text/css" href="${webroot}/styles/basc.css">
</head>

<body>
<div id="app">
    <%@ include file="../includes/hear.jsp" %>

    <div style="float: left;width: 200px;">
        <%@ include file="../includes/menu.jsp" %>
    </div>
    <div style="float: left;width: 800px;">
        <div class="operation" style="margin-left: 10px;margin-bottom: 10px;padding-top: 10px;">验证信息↓：<span class="Mess" id="Mess">${sessionScope.Mess}</span>
        </div>
        <el-form ref="form" :model="form" style="margin-left: 50px;">
            <el-form-item label="登录账号">
                <el-input v-model="form.username" style="width: 350px;" readonly></el-input>
            </el-form-item>

            <el-form-item label="员工姓名">
                <el-input v-model="form.ename" style="width: 350px;" readonly></el-input>
            </el-form-item>

            <el-form-item label="身份证号">
                <el-input v-model="form.idcode"style="width: 350px;"></el-input>
            </el-form-item>

            <el-form-item label="民　　族">
                <el-input v-model="form.nation"style="width: 350px;"></el-input>
            </el-form-item>

            <el-form-item label="政治面貌">
                    <el-input v-model="form.political" style="width: 350px;"></el-input>
            </el-form-item>

            <el-form-item label="家庭住址">
                <el-input v-model="form.homeaddr" placeholder="XX省XX市XX县XX街道XX号" style="width: 350px;"></el-input>
            </el-form-item>

            <el-form-item>
                <el-button type="primary" @click="onSubmit">立即更新</el-button>
            </el-form-item>
        </el-form>
    </div>
</div>
</body>
<STYLE>
    #app {
        width: 1280px;
        margin: 0 auto;
    }
</STYLE>
<script>
    new Vue({
        el: '#app',
        data: {
            form: {
                username: '${sessionScope.info.username}',
                ename: '${sessionScope.info.ename}',
                idcode: '${sessionScope.info.idcode}',
                nation: '${sessionScope.info.nation}',
                political: '${sessionScope.info.political}',
                homeaddr: '${sessionScope.info.homeaddr}',
            }
        },
        methods: {
            onSubmit() {
                var up_info = {
                    username:this.form.username,
                    idcode: this.form.idcode,
                    nation: this.form.nation,
                    political: this.form.political,
                    homeaddr: this.form.homeaddr,
                }
                window.location.href = '${webroot}/man.do?up_info=' + JSON.stringify(up_info) + '&action=update';
            }
        }
    })
</script>
</html>
